import request from "@/util/request";

// 获取文章详情
export const detail = (id) => request({
  url: '/qichong-record/api/article/detail',
  params: {
    id
  }
})

// 获取文章分页数据
export const page = (categoryId, productId, articleType, current) => request({
  url: '/qichong-record/api/article/page',
  params: {
    categoryId,
    productId,
    articleType,
    current,
    size: 10
  }
})

// 获取动态下的评论
export const getCommentList = (articleId, sort, current) => request({
  url: '/qichong-record/api/behavior/comment/article',
  params: {
    articleId,
    sort,
    current,
    size: 10
  }
})

// 获取评论下的回复
export const getReplyList = (commentId, sort, current) => request({
  url: '/qichong-record/api/behavior/comment/reply',
  params: {
    commentId,
    sort,
    current,
    size: 10
  }
})

// 获取评论详情
export const getCommentDetail = (id) => request({
  url: '/qichong-record/api/behavior/comment/detail',
  params: {
    id
  }
})

// 添加评论
export const commentSubmit = (comment) => request({
  url: '/qichong-record/api/behavior/comment/submit',
  method: 'post',
  data: comment
})

// 添加评论
export const removecomment = (ids) => request({
  url: '/qichong-record/api/behavior/comment/remove',
  method: 'post',
  params: {
    ids
  }
})
